import Vue from 'vue'
import Router from 'vue-router'

import Test from '../views/test';

import Home from '../views/home';
import Index from '../views/index';

/*用户管理*/
import Login from '../views/login';
import Register from '../views/register';
import GetPassword from '../views/getPassword';
import Personal from '../views/personal';
import EditPassword from '../views/editPassword';
import EditPhone from '../views/editPhone';
import EditName from '../views/editName';

/*服务模块*/
import ServeAll from '../views/serveAll';
import ServeDetail from '../views/serveDetail';
import ServeCreate from '../views/serveCreate';

/*订单模块*/
import Orders from '../views/orders';
import OrderPut from '../views/orderPut';
import OrderWait from '../views/orderWait';
import OrderProcess from '../views/orderProcess';
import OrderComplete from '../views/orderComplete';

import OrderAppraise from '../views/orderAppraise';
import OrderDetail from '../views/orderDetail';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: '',
          redirect: '/home/index'
        },
        {
          path: 'index',
          name: 'Index',
          component: Index
        },
        {
          path: 'personal',
          name: 'Personal',
          component: Personal
        },
        
         /*订单模块*/
        {
		      path: 'orders',
		      name: 'Orders',
		      component: Orders,
		      children: [
		        {
		          path: '',
		          redirect: '/home/orders/orderPut'
		        },
		        {
		          path: 'orderPut',
		          name: 'OrderPut',
		          component: OrderPut
		        },
		        {
		          path: 'orderWait',
		          name: 'OrderWait',
		          component: OrderWait
		        },
		        {
		          path: 'orderProcess',
		          name: 'OrderProcess',
		          component: OrderProcess
		        },
		        {
		          path: 'orderComplete',
		          name: 'OrderComplete',
		          component: OrderComplete
		        },
		        
		      ]
		    },
		    
      ]
    },
    
     /*订单模块*/
    {
      path: '/orderAppraise',
      name: 'OrderAppraise',
      component: OrderAppraise
    },
    {
      path: '/orderDetail',
      name: 'OrderDetail',
      component: OrderDetail
    },
    
    
    /* 服务模块*/
    {
      path: '/serveAll',
      name: 'ServeAll',
      component: ServeAll
    },
    {
      path: '/serveDetail',
      name: 'ServeDetail',
      component: ServeDetail
    },
    {
      path: '/serveCreate',
      name: 'ServeCreate',
      component: ServeCreate
    },
    
    /*用户个人管理*/
    {
      path: '/editPassword',
      name: 'EditPassword',
      component: EditPassword
    },
    {
      path: '/editPhone',
      name: 'EditPhone',
      component: EditPhone
    },
    {
      path: '/editName',
      name: 'EditName',
      component: EditName
    },

    
    
    //未登录--------------------------
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/getpassword',
      name: 'GetPassword',
      component: GetPassword
    },
    {
      path: '/test',
      name: 'Test',
      component: Test
    },
    {
      path: '*',
      redirect: '/login/'
    }
  ]
})
